<template>
	<view class="examinationResRec">
		<SwitchPatient></SwitchPatient>
		<view class="centent">
			<view class="btn">
				<view class="blue-btn">近一年</view>

				<uni-datetime-picker v-model="range" type="daterange"><view class="date-btn">选择时间 ▼</view></uni-datetime-picker>
			</view>
			<view class="box2">
				<view class="top">
					<view class="left">{{Data.list.packageName}}</view>
					<view class="right" v-if="Data.list.state == 0">预约成功</view>
					<text v-else-if="Data.list.state == 1" class="right">已完成</text>
				</view>
				<view class="bottom">
					<view class="left">
						<text class="title">就诊时间</text>
						<text class="data">{{Data.list.appointmentTime}}</text>
					</view>
					<view class="right" style="margin-top: 10rpx;">
						<text class="title">就诊人</text>
						<text class="data">{{Data.list.patientName}}</text>
					</view>
				</view>
				<view class="operation">
					<navigator url="../../reportSel/examinationReport/examinationReport"><button>查看报告</button></navigator>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import SwitchPatient from '@/components/SwitchPatient.vue';
import { reactive, onMounted } from 'vue';
import { medicalPatien } from '@/api/ExaminationService.js';
const Data = reactive({
	list:{}
});
onMounted(() => {
	medicalPatien({ id: 1, StartTime: "2021-11-18", EndingTime: "2022-11-18"}).then(({ data }) => {
		data.data.forEach(v=>{
			console.log(v)
			Data.list=v
		})
		console.log(Data.list)
	}).catch(err=>{
		console.log(err)
	});
});
</script>

<style lang="less">
.examinationResRec {
	.centent {
		width: 688rpx;
		margin: 40rpx 31rpx;
		.btn {
			display: flex;
			.blue-btn {
				width: 128rpx;
				height: 48rpx;
				border-radius: 30rpx;
				background-color: #006eff;
				color: #fff;
				font-family: 'PingFangSC-Thin', 'PingFang SC Thin', 'PingFang SC', sans-serif;
				font-weight: 200;
				font-style: normal;
				font-size: 12px;
				letter-spacing: 1px;
				line-height: 24px;
				text-align: center;
			}
			.date-btn::after {
				border: none;
			}
			.date-btn {
				margin-left: 20px;
				width: 180rpx;
				height: 48rpx;
				border-radius: 30rpx;
				background-color: #e4f0ff;
				font-weight: 200;
				font-style: normal;
				font-size: 12px;
				color: #006eff;
				line-height: 24px;
				text-align: center;
			}
		}

		.box2 {
			width: 686rpx;
			height: 400rpx;
			margin-top: 40rpx;

			background-color: #fff;
			border: 2rpx solid #f2f2f2;
			border-radius: 15rpx;
			.top {
				margin: 0 auto;
				width: 636rpx;
				height: 70rpx;
				display: flex;
				justify-content: space-between;
				margin-top: 30rpx;
				border-bottom: 1rpx solid #f2f2f2;
				.left {
					font-family: 'PingFangSC-Medium', 'PingFang SC Medium', 'PingFang SC', sans-serif;
					font-weight: 500;
					font-style: normal;
					font-size: 15px;
					color: #555555;
				}
				.right {
					font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
					font-weight: 400;
					font-style: normal;
					font-size: 12px;
					color: #006eff;
				}
			}
			.bottom {
				width: 636rpx;
				height: 150rpx;
				margin: 30rpx auto;
				border-bottom: 1rpx solid #f2f2f2;
				.title {
					font-family: 'PingFangSC-Light', 'PingFang SC Light', 'PingFang SC', sans-serif;
					font-weight: 200;
					font-style: normal;
					font-size: 12px;
					color: #aaaaaa;
				}
				.data {
					font-family: 'PingFangSC-Light', 'PingFang SC Light', 'PingFang SC', sans-serif;
					font-weight: 200;
					font-style: normal;
					font-size: 12px;
					margin-left: 20rpx;
				}
			}
			.operation {
				margin: 0 auto;
				width: 636rpx;
				height: 70rpx;

				button {
					float: right;
					width: 160rpx;
					height: 64rpx;
					text-align: center;
					line-height: 64rpx;
					font-family: 'PingFangHK-Medium', 'PingFang HK Medium', 'PingFang HK', sans-serif;
					font-weight: 500;
					font-style: normal;
					font-size: 12px;
					color: #ffffff;
					background-color: rgba(0, 110, 255, 1);
				}
			}
		}
	}
}
</style>
